package com.example.innospace.demos.web.mapper;

import com.example.innospace.demos.pojo.entity.ProjectFile;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProjectFileMapper {

    @Insert("insert into project_file (innospace.project_file.project_id,phase_type,file_path,oss_path,create_time,update_time)" +
            "values (#{projectId},#{phaseType},#{fileName},#{ossPath},#{createTime},#{updateTime})")
    void save(ProjectFile projectFile);

    @Select("select oss_path from project_file where project_id=#{id} and phase_type=#{Phase} ")
    List<String> findByIdAndPhase(@Param("id") Integer id, @Param("Phase")String Phase);

    @Delete("delete from project_file where project_id=#{projectId}")
    void deleteByProjectId(Integer projectId);
}
